package com.common.consts;

import lombok.Getter;

/**
 * @author: zhaojd1604@gmail.com
 * @date: 2019-01-02 16:50
 * @description: 通用web层接口返回码
 * @since: V0.0.1
 */
@Getter
public enum CommonRespCode {

    SUCCESS(100, "处理成功"),
    SERVER_EXCEPTION(900, "服务器异常"),

    // 权限相关返回码
    APP_NOT_IN_AUTH(1000, "应用未授权"),
    NO_AUTH(1001, "没有接口权限"),
    SIGN_EXPIRED(1002, "签名已过期"),
    ACCESS_KEY_INVALIDATED(1003, "AccessKey无效"),
    NONSE_IS_USED(1004, "随机数已被使用"),

    BUSINESS_EXCEPTION(1100, "业务异常");

    private Integer code;
    private String message;

    CommonRespCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}